package services

import java.util.UUID
import javax.inject.Inject

import models.User
import play.modules.reactivemongo.ReactiveMongoApi

import scala.concurrent.{ExecutionContext, Future}

/**
  * Created by xiaofei on 2016/8/17.
  */
trait UserSercice extends CRUDService[User,UUID]{
}

import reactivemongo.play.json.collection._

class UserMongoService @Inject()(val reactiveMongoApi: ReactiveMongoApi)
  extends MongoCRUDService[User,UUID] with UserSercice{
  override def collection(implicit ec: ExecutionContext):Future[JSONCollection]=
    reactiveMongoApi.database.map(_.collection[JSONCollection]("users"))
}
